Skip to content

MPIIT: Add support for skipJobTriggers switch for triggered job lists#77544

Open
oharan2 wants to merge 2 commits intoopenshift:mainfrom
oharan2:master_switch
Open

MPIIT: Add support for skipJobTriggers switch for triggered job lists#77544
oharan2 wants to merge 2 commits intoopenshift:mainfrom
oharan2:master_switch

Conversation

@oharan2
Copy link
Copy Markdown
Contributor

@oharan2 oharan2 commented Apr 8, 2026

This PR adds an optional top-level boolean skipJobTriggers on each job list Json object.

When set to true, Gangway-API job triggering is skipped for that object’s entire jobList; post tasks still run.
Omitted or false preserves existing behavior.

trigCondFlgs masks only control which trigger-condition steps run; they do not turn off the whole block.
This gives an explicit vault-driven switch for “disable all jobs in this group” without misusing trigCond or toggling every active field.

Will be verified using the following jobList:

{"jobType": "periodic", "jobName": "periodic-ci-CSPI-QE-MSI-openshift-ci-trigger-poc-test-fail-setup", "active": true}

This job is failing on setup, so if triggered, nothing happens.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 8, 2026
@openshift-ci openshift-ci bot requested review from amp-rh and shakyav April 8, 2026 13:29
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@oharan2: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
periodic-ci-rhpit-interop-tests-main-weekly_trigger-opp-interop-jobs-watcher-bot-message N/A periodic Registry content changed
periodic-ci-rhpit-interop-tests-main-weekly_trigger-rosa-hypershift-lp-watcher-bot-message-421 N/A periodic Registry content changed
periodic-ci-rhpit-interop-tests-main-weekly_trigger-ocp-self-managed-lp-interop--fips--422 N/A periodic Registry content changed
periodic-ci-rhpit-interop-tests-main-weekly_trigger-bm-gs--lp-interop N/A periodic Registry content changed
periodic-ci-rhpit-interop-tests-main-weekly_trigger-opp-interop-jobs-trigger N/A periodic Registry content changed
periodic-ci-rhpit-interop-tests-main-weekly_trigger-ocp-self-managed-lp-interop--fips--watcher-bot--422 N/A periodic Registry content changed
periodic-ci-rhpit-interop-tests-main-weekly_trigger-rosa-hypershift-layered-product-interop-421 N/A periodic Registry content changed
periodic-ci-rhpit-interop-tests-main-weekly_trigger-bm-gs--lp-interop--watcher-bot N/A periodic Registry content changed
periodic-ci-rhpit-interop-tests-main-weekly_trigger-tmp-interop-jobs-trigger N/A periodic Periodic changed

Prior to this PR being merged, you will need to either run and acknowledge or opt to skip these rehearsals.

Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@oharan2
Copy link
Copy Markdown
Contributor Author

oharan2 commented Apr 8, 2026

/pj-rehearse periodic-ci-rhpit-interop-tests-main-weekly_trigger-tmp-interop-jobs-trigger

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@oharan2: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@oharan2
Copy link
Copy Markdown
Contributor Author

oharan2 commented Apr 8, 2026

/pj-rehearse periodic-ci-rhpit-interop-tests-main-weekly_trigger-tmp-interop-jobs-trigger

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@oharan2: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 8, 2026

@oharan2: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@etirta
Copy link
Copy Markdown
Contributor

etirta commented Apr 8, 2026

@oharan2 Please see https://redhat.atlassian.net/browse/INTEROP-8019?focusedCommentId=16653758
I don't see any need for this PR. It can be achieved already without this PR. Thx.

@amp-rh
Copy link
Copy Markdown
Contributor

amp-rh commented Apr 9, 2026

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 9, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 9, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amp-rh, oharan2

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@etirta
Copy link
Copy Markdown
Contributor

etirta commented Apr 9, 2026

/lgtm cancel

I'm sorry not signing off on this yet. And even if master switch approach like this is desired, there are several issue with current implementation:

  • It doesn't conform with our current Best Practices (using echo while xtrace is active). Please configure the AI Agent per our Best Practices to ensure the Best Practices are followed.
  • It doesn't make sense to still allow the postTask to run. The idea of the postTask is the follow up after jobList are executed (assuming their triggering conditions are met).
  • For efficiency Master switch can be evaluated in the outer loop to exclude the skipped entry to begin with.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 9, 2026
Copy link
Copy Markdown
Contributor

@etirta etirta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am okay with this more streamlined implementation.

I would like to see a test using the CI Operator Emulator for a JT__TRIG_JOB_LIST that contains two entries: one with disabled: true and the other without that key.

Comment on lines +254 to +259
) | [
(.trigCond//[] | @json),
(.jobList//[] | @json),
(.postTask//[] | @json),
(if (.skipJobTriggers // false) then 1 else 0 end | tostring)
] | @tsv
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a master switch is desired, then it should be treated as if the whole entry is undefined or excluded:

Suggested change
) | [
(.trigCond//[] | @json),
(.jobList//[] | @json),
(.postTask//[] | @json),
(if (.skipJobTriggers // false) then 1 else 0 end | tostring)
] | @tsv
) | select(.disabled != true) |
[(.trigCond//[] | @json), (.jobList//[] | @json), (.postTask//[] | @json)] | @tsv

Remove all other changes.

Comment on lines +24 to +25
"skipJobTriggers": <true|false>, # Optional. Master switch: if true,
# skip all `jobList` triggers; `postTask` still runs.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, the master switch Key name could be confused with just skipping the trigCond. Following an idiomatic approach and borrowing from other frameworks such as Systemd Units and many CI Configs, a simple Key name like disabled can be used without any ambiguity.

Second, use [...] to indicate the default value.

Suggested change
"skipJobTriggers": <true|false>, # Optional. Master switch: if true,
# skip all `jobList` triggers; `postTask` still runs.
"disabled": <true|[false]>, # Optional. Set to `true` to skip this entry entirely.

Comment on lines 285 to 293
3. **(If applicable)** Check trigger conditions written by pre-Steps (e.g., resource ownership). Trigger conditions are only checked when
the bitwise mask `(trigCondFlgs & JT__TRIG_COND_EXEC_FLGS)` evaluates to non-0. If any checked trigger condition is not met, the rest
of the processing is skipped.
4. **(If applicable)** Loop through the jobs-to-trigger JSON and trigger each Job that has `active: true` and matches the set trigger condition, if any.
This Step is skipped if `JT__SKIP_TRIG_MAIN_JOBS` is non-zero.
For each JSON list object, its `jobList` block is skipped when `skipJobTriggers` key is set to true.
If the step env `JT__SKIP_TRIG_MAIN_JOBS` is non-zero (set in the `ci-operator` config), every `jobList` item is skipped the same way.
5. **(If applicable)** Set execution markers so the downstream processes can determine whether to execute post-Steps. Markers are only set when
the bitwise mask `(postTaskFlgs & JT__POST_TASK_EXEC_FLGS)` evaluates to non-0.
6. Continue processing until all Jobs have been processed.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
6. Continue processing until all Jobs have been processed.
3. Loop through `JT__TRIG_JOB_LIST`, skipping entries with `disabled: true`.
4. **(If applicable)** Check trigger conditions written by pre-Steps (e.g., resource ownership). Trigger conditions are only checked when
the bitwise mask `(trigCondFlgs & JT__TRIG_COND_EXEC_FLGS)` evaluates to non-0. If any checked trigger condition is not met, the rest
of the processing is skipped.
5. **(If applicable)** Loop through the jobs-to-trigger JSON and trigger each Job that has `active: true` and matches the set trigger condition, if any.
This Step is skipped if `JT__SKIP_TRIG_MAIN_JOBS` is non-zero.
6. **(If applicable)** Set execution markers so the downstream processes can determine whether to execute post-Steps. Markers are only set when
the bitwise mask `(postTaskFlgs & JT__POST_TASK_EXEC_FLGS)` evaluates to non-0.
7. Continue processing until all Jobs have been processed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants